<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<c:set value="<%=request.getContextPath()%>" var="ctx"></c:set>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>表单</title>
    <meta name="keywords" content="关键字台">
    <meta name="description" content="描述"> 
    <link href="${ctx}/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="${ctx}/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="${ctx}/css/animate.css" rel="stylesheet">
    <link href="${ctx}/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="${ctx}/css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">   
</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
                    <div class="col-lg-12">
      
   

        				   <div class="row wrapper border-bottom white-bg ibox-title">
                                <div class="col-lg-10">
                                    <h3>操作日志</h3>
                                </div>
                            </div>
                            
                            
                                  <div class="wrapper wrapper-content animated fadeInRight">
	                            <div class="ibox-title">
                                <table  class="table table-bordered table-hover text-center" id="tb">
                                    <thead>
                                        <tr>
                                            <th class="text-center">序号</th>
                                            <th class="text-center">操作人</th>
                                            <th class="text-center">操作内容</th>
                                            <th class="text-center">机器IP地址</th>
                                            <th class="text-center">操作时间</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
    </div>
    
    
    
 
    
    
    
    <!-- 全局js -->
    <script src="${ctx}/js/jquery.min.js?v=2.1.4"></script>
    <script src="${ctx}/js/bootstrap.min.js?v=3.3.6"></script>
    <!-- 自定义js -->
    <script src="${ctx}/js/content.js?v=1.0.0"></script>
    <!-- jQuery Validation plugin javascript-->
    <script src="${ctx}/js/plugins/validate/jquery.validate.min.js"></script>
    <script src="${ctx}/js/plugins/validate/messages_zh.min.js"></script>
    <script src="${ctx}/js/plugins/dataTables/jquery.dataTables.js"></script>
	<script src="${ctx}/js/plugins/dataTables/dataTables.bootstrap.js"></script>
	<script src="${ctx}/js/common.js"></script>
    <script src="${ctx}/js/plugins/layer/layer.min.js"></script>
    <script src="${ctx}/js/qrcode/Math.uuid.js"></script>
   	<script type="text/javascript">
   	$(document).ready(
   			function() {
   				var table = $('#tb').DataTable({
   					"bPaginate":true,//翻页功能
   					"bSort":false,//排序功能
   					"searching":false,
   					"iDisplayLength": 20,//每页显示的行数
   					'bLengthChange': false, //是否允许用户自定义每页显示条数。
   					"bProcessing": false, // 是否显示取数据时的那个等待提示
   	                "bServerSide": true,//这个用来指明是通过服务端来取数据
   	                "sAjaxSource": "${ctx}/log/listOperating",//这个是请求的地址
   	                "fnServerData": retrieveData, // 获取数据的处理函数
   					"aoColumns": [
   											{ "sClass": "center","bSearchable": false,"aTargets" : [0],
   											  "mRender": function(data, type, full) {
   				                                if(full.seq == null){
   													return '';
   												}else{
   													return full.seq;
   												}
   											}},
   											{ "sClass": "center","mRender": function(data, type, full) {
   						 						if(full.name == null){
   													return '';
   												}else{
   													return full.name;
   												}
   											 }},
   											{ "sClass": "center","mRender": function(data, type, full) {
   												if(full.content == null){
   													return '';
   												}else{
   													return full.content;
   												}
   											}},
   											{ "sClass": "center", "mRender": function(data, type, full) {
   												if(full.ipAddr == null){
   													return '';
   												}else{
   													return full.ipAddr;
   												}		
   											}},
   											{ "sClass": "center", "mRender": function(data, type, full) {
   												if(full.operationTime == null){
   													return '';
   												}else{
   													return full.operationTime;
   												}
   											}}
   										]
   				});
   			});
   				
   		//分页方法
   		function retrieveData(sSource,aoData, fnCallback){
   			var dataArr = eval("["+JSON.stringify(aoData)+"]");
   			$.ajax({
   	            url : sSource, //这个就是请求地址对应sAjaxSource
   	            data : {"aoData":JSON.stringify(dataArr)},//这个是把datatable的一些基本数据传给后台,比如起始位置,每页显示的行数
   	            type : 'post',
   	            dataType : 'json',
   	            async : false,
   	            success : function(result) {
   	                fnCallback(result);//把返回的数据传给这个方法就可以了,datatable会自动绑定数据的
   	            },
   	            error : function(msg) {
   	            }
   	        });
   		}
	</script>
</body>
</html>
